# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-gls
pkgver=1.2.1
pkgrel=0
pkgdesc="pythonic generic language server"
url="https://github.com/openlawlibrary/pygls"
arch="noarch"
license="Apache-2.0"
depends="py3-lsprotocol"
makedepends="py3-gpep517 py3-wheel py3-poetry-core"
checkdepends="py3-pytest py3-pytest-asyncio"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/openlawlibrary/pygls/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/pygls-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
59c3265fb57720837b146bd5f3554950ac08c51f9f62841fe78881e008a6b4036025b4be48d74bff9b901b9de712a1426c738a525d2e92c8c00d527d2862433c  py3-gls-1.2.1.tar.gz
"
